package com.farm.monitor;

// 具体观察者 - 气压监控器
public class PressureMonitor implements SensorObserver {
    @Override
    public void update(EnvironmentSensor sensor) {
        System.out.println("气压监控器: 当前气压 = " + sensor.getPressure() + "hPa");
        if (sensor.getPressure()< 980 || sensor.getPressure() > 1030) {
            System.out.println("警告: 气压异常!");
        }
    }
}
